<?php

namespace App\Exceptions;

class SuperAdminException extends BaseException
{
    const CODE_1001 = 1001;
    const CODE_1002 = 1002;
    const CODE_1003 = 1003;
    const CODE_1004 = 1004;
    const CODE_1005 = 1005;
    const CODE_1006 = 1006;
    const CODE_1007 = 1007;
    const CODE_1008 = 1008;
    const CODE_1009 = 1009;
    const CODE_2000 = 2000;
    const CODE_2001 = 2001;
    const CODE_2002 = 2002;

    protected int   $baseCode = self::BASE_CODE_OF_ADMIN;    //
    protected array $showMsg  = [
        self::CODE_1001 => '登录状态失效，请重新登录',
        self::CODE_1002 => '存在相同name修改失败',
        self::CODE_1003 => '菜单不存在',
        self::CODE_1004 => '此菜单存在子菜单不可删除',
        self::CODE_1005 => '此菜单有角色正在作为首页，不可删除',
        self::CODE_1006 => '存在相同角色',
        self::CODE_1007 => '角色不存在',
        self::CODE_1008 => '此角色有用户正在使用，禁止删除',
        self::CODE_1009 => '此角色存在子角色，不允许删除',

        self::CODE_2000 => '没有接口权限',
        self::CODE_2001 => 'API已存在',
        self::CODE_2002 => 'API不存在',
    ];

    function __construct($msg = '', $code = 0)
    {
        parent::__construct($msg, $code);
    }
}
